import {
	request,
} from '@/api/request';
const apiList = [{
		// /api/index/getGoods
		name: 'createCustomer',
		url: '/api/index/createCustomer',
	},
	// getCustomerList
	{
		name: 'getCustomerList',
		url: '/api/index/getCustomerList',
		method:'GET'
	},
	// getCustomerDetail
	{
		name: 'getCustomerDetail',
		url: '/api/index/getCustomerDetail',
		method:'GET'
	},
	// getTradeList
	{
		name: 'getTradeList',
		url: '/api/index/getTradeList',
		method:'GET'
	},
	// createTrade
	{
		name: 'createTrade',
		url: '/api/index/createTrade'
	},
	// getVisitList
	{
		name: 'getVisitList',
		url: '/api/index/getVisitList',
		method:'GET'
	},
	// createVisit
	{
		name: 'createVisit',
		url: '/api/index/createVisit',
	},
	// getTotal
	{
		name: 'getTotal',
		url: '/api/index/getTotal',
		method:'GET'
	},
	// createCheck
	{
		name: 'createCheck',
		url: '/api/index/createCheck',
	},
	// getCheckList
	{
		name: 'getCheckList',
		url: '/api/index/getCheckList',
		method:'GET'
	},
	// getUserList
	{
		name: 'getUserList',
		url: '/api/index/getUserList',
		method:'GET'
	},
	// addUser
	{
		name: 'addUser',
		url: '/api/index/addUser',
	},
	// getDepartList
	{
		name: 'getDepartList',
		url: '/api/index/getDepartList',
		method:'GET'
	},
	// getKuCun
	{
		name: 'getKuCun',
		url: '/api/index/getKuCun',
		method:'GET'
	},
	// getCankuList
	{
		name: 'getCankuList',
		url: '/api/index/getCankuList',
		method:'GET'
	},
	// getCateList
	{
		name: 'getCateList',
		url: '/api/index/getCateList',
		method:'GET'
	},
	// getSubCateList
	{
		name: 'getSubCateList',
		url: '/api/index/getSubCateList',
		method:'GET'
	},
	// getUserList
	{
		name: 'getUserList',
		url: '/api/index/getUserList',
		method:'GET'
	},
	// /api/index/readConfig
	{
		name: 'readConfig',
		url: '/api/index/readConfig',
		method:'GET'
	},
	// /api/index/appendCustomerImage?id=xxx$image
	{
		name: 'appendCustomerImage',
		url: '/api/index/appendCustomerImage',
	},
	// getNotifyList
	{
		name: 'getNotifyList',
		url: '/api/index/getNotifyList',
		method:'GET'
	},
	// createNotify
	{
		name: 'createNotify',
		url: '/api/index/createNotify',
	},
]

module.exports = apiList.reduce((mode, params) => {
	mode[params.name] = (data) => request({
		url: params.url,
		method: params.method || 'POST',
		data
	})
	return mode
}, {})